<?php
	require_once '../../controller/carencia/' . basename(__FILE__);
	$pagina[0] = array('Pesquisar Carência','../../view/carencia/pesquisarSolicitacao.php');
	$pagina[1] = array('Solicitar Carência');
	require_once '../../template/header.php';
?>
<ul class="navmenu">	
	<li><a class="voltar" href="pesquisarSolicitacao.php">Voltar</a></li>
</ul>
<div id="conteudo">
    <form method="post" action="<?php echo basename(__FILE__);?>" >
        <?php TMensagens::exibirStatus( $erro, $sucesso ) ?>
        <fieldset>
		    <legend>Formulário:</legend>
	        <dl>
	        	<dt>Orgão:</dt>
        		<dd>
        			<?php if ($pfcid == PerfilComportamental::Orgao OR $pfcid == PerfilComportamental::NucleoGestor): ?>
        			<select name="ddlOrgaoID" id="ddlOrgaoID" class="textoMedio" disabled="disabled">
        				<option value="<?php echo $usuario->orgaoid ?>"><?php echo $usuario->getOrgao()->sigla ?></option>
        			</select>
        			<?php else: ?>
        			<select name="ddlOrgaoID" id="ddlOrgaoID" class="textoMedio" onchange="javascript: document.getElementById('hidOrgaoID').value = this.options[this.selectedIndex].value; document.forms[1].submit();"> <?php TSelect::MontaDropDownList($listaOrgao,$orgaoId,'orgaoid','sigla');?></select>
    				<?php endif; ?>
    			</dd>
	        	
        		<dt>Lotacao:</dt>
        		<dd>
        			<select name="ddlLotacaoID" class="textoMedio"  onchange="javascript: document.getElementById('hidOrgaoID').value = document.getElementById('ddlOrgaoID').options[document.getElementById('ddlOrgaoID').selectedIndex].value;document.getElementById('hidLotacaoID').value = this.options[this.selectedIndex].value; document.forms[1].submit();">
        			    <?php TSelect::MontaDropDownList($listaLotacao,$LotacaoId,'lotacaoid','nome');?>
    			    </select>
    			</dd>
	        	
				<dt>Cargo:</dt>
        		<dd>
        			<select name="ddlCargoID" class="textoMedio">
                        <?php TSelect::MontaDropDownList($listaCargo,0,'cargoid','descricao');?>
                    </select>
                </dd>
	        
				<dt>Quantidade:</dt>
        		<dd><input type="text" name="txtQuantidade" class="textoMedio" /></dd>
    		</dl>
	    </fieldset>
        	
    	<fieldset>
		    <legend>Informações sobre a Lotação:</legend>	
        	<?php 
        		$d = new TDataTableLotacaoVagasInfo($LotacaoId);
        		echo $d->render(); 
        	?>       
        </fieldset>
        
        <fieldset>
        	<legend>Solicitar</legend>
        	<dl>
				<dt>Parecer:</dt>
    			<dd><textarea name="txtObservacao" rows="4" class="textoGrande"></textarea></dd>
    		</dl>
        </fieldset>
        
        <p class="botoeira">
        	<input type="submit" name="btnAcao" title="Solicitar" value="Solicitar" onclick="javascript: return confirm('Deseja realmente Solicitar Carência para Lotação selecionada?');"/>&nbsp;
    	</p>
     </form>
     <form name="formSelect" method="post" action="<?php echo basename(__FILE__);?>">
     	<input type="hidden" id="hidOrgaoID" name="hidOrgaoID" />
     	<input type="hidden" id="hidLotacaoID" name="hidLotacaoID" />
 	</form>
</div>
<?php require_once '../../template/footer.php'; ?>